#ifndef __CPPTUTOROVERLOADINGUSINGMEMBERFUNC_H__
#define __CPPTUTOROVERLOADINGUSINGMEMBERFUNC_H__

#include <iostream>

using namespace std;

class CcppTutorOverloadingUsingMemberFunc
{
	private:
		int m_nValue_A;
		int m_anArray [5];

	public:
		CcppTutorOverloadingUsingMemberFunc ();
		CcppTutorOverloadingUsingMemberFunc (int);
	   ~CcppTutorOverloadingUsingMemberFunc ();
		
	    void m_GetValue ();
	   //oerloading member function
		CcppTutorOverloadingUsingMemberFunc operator+ (int nValue_A)
		{
			return CcppTutorOverloadingUsingMemberFunc (m_nValue_A + nValue_A);
		}

		// prefix increment operator
		CcppTutorOverloadingUsingMemberFunc& operator++ ()
		{
			++ m_nValue_A;
			return *this;
		}

		// postfix decrement operator
        // Fix :  warning: reference to local variable tmp returned [not returning reference]
		//CcppTutorOverloadingUsingMemberFunc& operator++ (int)
		CcppTutorOverloadingUsingMemberFunc operator++ (int)        
		{
			CcppTutorOverloadingUsingMemberFunc tmp (m_nValue_A);
            ++ (*this);
            return tmp;
		}

		// subscript operator
		int& operator[] (const int index)
		{
			return m_anArray [index];			
		}

		// assignment operator
		void operator= (const CcppTutorOverloadingUsingMemberFunc& tmp)
		{
			m_nValue_A = tmp.m_nValue_A;
		}
	
		//CcppTutorOverloadingUsingMemberFunc& operator= (const CcppTutorOverloadingUsingMemberFunc& tmp)
		//{
		//}
};

extern CcppTutorOverloadingUsingMemberFunc g_OvrldUMF;

#endif //__CPPTUTOROVERLOADINGUSINGMEMBERFUNC_H__
